	//根据用户选定的条件查询用户
	function doEmpSearch() {
	    var lister = __get("EMPLister");
	    //var url = lister.getAttribute("tt.data.url");
	    //url = __setUrlParam(url, "keyName", __trim(__get("keyName").value));
	    //url = __setUrlParam(url, "keyPost", __trim(__get("keyPost").value));
	    //url = __setUrlParam(url, "keyState", __trim(__get("keyState").value));
	    //url = __setUrlParam(url, "search", "true");
	    var selid={};
	    selid["keyName"] = __trim(__get("keyName").value);
	    selid["keyPost"] = __trim(__get("keyPost").value);
	    selid["search"]= "true";
		doSelper(selid);
	    //lister.setAttribute("tt.data.url", url);
	    //lister.reload();
	    __get("domEmpFilterDesc").innerHTML = "查询用户结果";
	}
    //用户搜索Enter监控
    function doUserSearchKey() {
      var k = event.keyCode;
      if (k==13) {
        doEmpSearch();
      }
    }

    var _searchPanel = null;
    var _spView = false;
    var _lastRow = null;

    /**
     * 模拟一个按键
     */
    function fireKey($d, $kc) {
      var e = document.createEventObject();
      e.keyCode = $kc;
      $d.fireEvent("onkeyup", e);
    }
    //树检索控制按键的处理
    function doTreeKeyDown() {
      var k = event.keyCode;
      if (k==13) {
         if (!_spView) {
           doTreeSearchGo();
         }else { //显示选中的内容
           if (_lastRow!=null) {
             _lastRow.all.tags("A")[0].click();
           }
         }
      }
      if (k==27) { //esc
        if (_searchPanel!=null) {
          searchPanelClose();
        }
      }

      if (_spView) {
        if (k==38 || k==40) { //上或下
          var d = __get("SPTable");
          var s = d.getAttribute("tt.size")*1; //总行数
          if (s!=0) {
            var c = d.getAttribute("tt.current"); //当前行
            if (c==null) {
              c = -1;
            }
            if (k==38) {
              c = c-1;
              if (c<0) {c=s-1;}
            }else {
              c = c+1;
              if (c==s) {c = 0;}
            }
            if (_lastRow!=null) {
              _lastRow.style.backgroundColor = "transparent";
            }
            d.rows[c].style.backgroundColor = "#CFEBA5";
            _lastRow = d.rows[c];
            d.setAttribute("tt.current", c);
            _lastRow.scrollIntoView(false);
          }
        }
      }
    }

    function doTreeSearchGo() {
       var v = __get("keyTree").value;
       if (__isEmpty(v)) {
          alert("关键字不能为空");
          return;
       }
      _Xuice.url("xml/tree_search_xml.jsp?key=" + encodeURIComponent(v), finishSearch, false);
      function finishSearch($doc) {
        var ns = $doc.selectNodes("/xuice/node");
        var sb = [];
        sb.push("<div onmousedown='event.cancelBubble=true;' style='position:absolute; left:0px; top:0px; z-index:517; width:200px;height:10px;padding:2px;filter: DropShadow(Color=#eeeeee, OffX=2, OffY=2, Positive=45);'>");
        sb.push("<table width=100% cellpadding=2 cellspacing=0 style='border-width:1 1 0 1;border-style:solid;border-color:#aaaaaa'>");
        sb.push("<tr><td style='background-color:#E4E8F8'><img src="+_c+_image+"/img/lxp.gif align=absmiddle style='margin-right:3px'>查询结果：");
        sb.push("</td></tr></table>");
        sb.push("<div style='width:100%;height:150px;overflow-y:auto' style='border:1px solid #aaaaaa' style='background-color:#f7f7f7' id=SPContainer>");
        sb.push("<table width=100% cellpadding=2 cellspacing=0 id=SPTable tt.size=" + ns.length + ">");
        if (ns.length==0) {
          sb.push("<tr><td style='color:red'>没有匹配的节点</td></tr>");
        }else {
          for (var i=0; i<ns.length; i++) {
            var t = ns[i].getAttribute("type");
            sb.push('<tr><td>');
            sb.push(getTypeDesc(t));
            sb.push("<a href=javascript:doGoNode('" + ns[i].getAttribute("path") + "','" + ns[i].getAttribute("uuid") + "')>");
            sb.push(ns[i].text);
            sb.push('</a></td></tr>');
          }
        }

        sb.push("</table>");
        sb.push("</div>");
        sb.push("</div>");
        if (_searchPanel==null) {
          _searchPanel = new JPanel();
        }
        _lastRow = null;
        _searchPanel.getNode().innerHTML = sb.join("");;
        _searchPanel.setVis(true);
        _spView = true;
        var n = _searchPanel.getNode();
        //搜索层的上边距和左边距
        var x = 62;
        var y = 38;
        n.style.left = x;
        n.style.top = y;
        var h = __get("SPTable").clientHeight;
        if (h<150) {
           __get("SPContainer").style.height = h+2;
        }else {
           __get("SPContainer").style.height = "150px";
        }

        document.body.attachEvent("onmousedown", searchPanelClose);

        if (ns.length==0) {
          setTimeout(searchPanelClose, 1500);
        }else {
          var dIp = __get("keyTree");
          dIp.focus();
          fireKey(dIp, 40);
        }

      }

      //根据类型的不同返回不同的图标
      function getTypeDesc(t) {
        if (t=="O") {
          return "<img src="+_c+_image+"/img/org.gif align=absmiddle style='margin-right:3px'>";
        } else if (t=="D") {
          return "<img src="+_c+_image+"/img/dept.gif align=absmiddle style='margin-right:3px'>";
        } else if (t=="P") {
          return "<img src="+_c+_image+"/img/pos.gif align=absmiddle style='margin-right:3px'>";
        } else if (t=="R") {
          return "<img src="+_c+_image+"/img/role.gif align=absmiddle style='margin-right:3px'>";
        }
      }

    }

    //关闭搜索的层
    function searchPanelClose() {
      _spView = false;
      _searchPanel.setVis(false);
      document.body.detachEvent("onmousedown", searchPanelClose);
    }

    //跳至某节点
    function doGoNode($path, $uuid) {
      searchPanelClose();
      ATree.expandByPathSyntax($path);
    }